package cn.wolfcode.mapper;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.qo.EmployeeQueryObject;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    //简单增删改查
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);

    //批量删除
    void deleteList(@Param("ids") Long[] ids);

    void deleteImport(@Param("ids") List<Long> ids);

    //高级查询
    List<Employee> queryPage(QueryObject qo);

    //保存员工和角色之间的关系
    void saveRelation(@Param("employeeId") Long employeeId, @Param("roleIds") Long[] roleIds);

    //删除中间表对应id的数据
    void deleteRelation(Long id);

    //批量删除中间表对应id的数据
    void deleteRelationList(@Param("ids") Long[] ids);

    //用于用户登录
    Employee selectLogin(@Param("username") String username, @Param("password") String password);

    //用户名验证
    Employee selectByUsername(String username);

    //修改status状态
    void changeStatus(@Param("id") Long id, @Param("status") boolean status);

    //根据高级查询结果导出
    List<Employee> selectByKeyword(EmployeeQueryObject eqo);

    //获取所有的id
    List<Long> selectIds();

    int selectUnRead(Long empId);
}